package day07.Collection;

import java.util.ArrayList;
import java.util.Collection;
import java.util.function.Predicate;

public class Lian02 {
    public static void main(String[] args) {
        Collection<String >list=new ArrayList<>();
        list.add("a");
        list.add("b");
        list.add("c");
        list.add("ccc");
        list.removeIf((String s)->{
            return s.length()==1;
        });
        System.out.println(list);
    }

    private static void method01(Collection<String> list) {
        list.removeIf(new Predicate<String>() {
            @Override
            public boolean test(String s) {
                return s.length()==1;
            }
        });
    }
}
